<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <body>

        <ui:composition template="./../templates/templateSesion.xhtml">

            <ui:define name="menuderecho">
                <ul class="nav nav-pills nav-stacked">
                    <li class="active"><a href="#"><h4>Gestionar Mi Cuenta</h4></a></li>
                </ul>
            </ui:define>

            <ui:define name="contenido">
                <h:form id="AdministrativoListForm">
                    <p:panel header="Lista Articulos">
                        <p:dataTable id="datalist" value="#{articuloManagedBean.lstArticulos}" var="item"
                                     selectionMode="single" selection="#{articuloManagedBean.objArticulo}"
                                     paginator="true"
                                     rowKey="#{item.articuloPK}"
                                     rows="10"
                                     rowsPerPageTemplate="10,20,30,40,50"
                                     >

                            <p:ajax event="rowSelect"   />
                            <p:ajax event="rowUnselect" />

                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Id Articulo"/>
                                </f:facet>
                                <h:outputText value="#{item.articuloPK.idarticulo}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Titulo"/>
                                </f:facet>
                                <h:outputText value="#{item.titulo}"/>
                            </p:column>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputText value="Abstract"/>
                                </f:facet>
                                <h:outputText value="#{item.abstract1}"/>
                            </p:column>
                            
                        </p:dataTable>
                    </p:panel>
                    <p:panel rendered="#{articuloManagedBean.lstArticulos.size() != 0}">
                        <f:facet name="footer" >
                                <a href="/GestInt/faces/inicio/LeerArticulo.xhtml" > LEER </a>
                        </f:facet>
                    </p:panel>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
